﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.WmsManagement;

namespace Digitalmes.Model.WmsManagement
{
    /// <summary>
    /// 出库
    /// </summary>
	[Table("Outbound")]

    [Display(Name = "_Model.Outbound")]
    public class Outbound : TopBasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._Outbound._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._Outbound._Material")]
        [Comment("物料")]
        public MaterialDoc Material { get; set; }
        [Display(Name = "_Model._Outbound._Material")]
        [Comment("物料")]
        public long? MaterialId { get; set; }
        [Display(Name = "_Model._Outbound._Wo")]
        [Comment("生产工单")]
        public string Wo { get; set; }
        [Display(Name = "_Model._Outbound._Sn")]
        [Comment("追溯码")]
        public string Sn { get; set; }
        [Display(Name = "_Model._Outbound._OutQty")]
        [Comment("出库数量")]
        [Precision(18,2)]
        public decimal? OutQty { get; set; }
        [Display(Name = "_Model._Outbound._OutMode")]
        [Comment("出库方式")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public InOutEnum? OutMode { get; set; }
        [Display(Name = "_Model._Outbound._StoreQty")]
        [Comment("在库数量")]
        [Precision(18,2)]
        public decimal? StoreQty { get; set; }
        [Display(Name = "_Model._Outbound._SheetId")]
        [Comment("出库单号")]
        public long? SheetId { get; set; }
   
         public OutboundSheet Sheet { get; set; }



        [Display(Name = "_Model._Outbound._SheetNo")]
        [Comment("出库单号")]
        public string SheetNo { get; set; }
        [Display(Name = "_Model._Outbound._OutOperator")]
        [Comment("出库")]
        public string OutOperator { get; set; }
        [Display(Name = "_Model._Outbound._OutboundDate")]
        [Comment("出库时间")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public DateTime? OutboundDate { get; set; }
        [Display(Name = "_Model._Outbound._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
